package com.theydream.ichingwisdom.tab;

import android.app.Activity;
import android.content.Intent;

import com.theydream.ichingwisdom.R;
import com.theydream.ichingwisdom.ui.Author;
import com.theydream.ichingwisdom.ui.Cards;
import com.theydream.ichingwisdom.ui.Divination;
import com.theydream.ichingwisdom.ui.IChing;

public class TabbarView extends TabHostProvider {

	
	private Tab firstTab;
	private Tab secondTab;
	private Tab thirdTab;
	private Tab fourTab;
	private TabView tabView;
	public TabbarView(Activity context) {
		super(context);
		// TODO Auto-generated constructor stub
	}

	@Override
	public TabView getTabHost(String category) {
		tabView = new TabView(context);
		//tabView.setBackgroundID(R.drawable.menubar);
		//tabView.setBackgroundID(R.drawable.menubar_bg);
		
		
		firstTab = new Tab(context, "One");
		firstTab.setIntent(new Intent(context,Author.class),0);
		firstTab.setIcon(R.drawable.menu_intro);
		firstTab.setIconSelected(R.drawable.menu_intro);
		firstTab.setTagTitle(R.string.Author);
		firstTab.setIcon(R.drawable.menu_intro);
		firstTab.setIconSelected(R.drawable.menu_intro);
//		firstTab.setTagTitle(R.string.MENU_MAP);
		
		secondTab = new Tab(context, "Two");
		secondTab.setIntent(new Intent(context,IChing.class),1);
		secondTab.setIcon(R.drawable.menu_iching);
		secondTab.setIconSelected(R.drawable.menu_iching);
		secondTab.setTagTitle(R.string.IChing);
//		secondTab = new Tab(context, "Two");
////		secondTab.setIntent(new Intent(context,CatchView.class),1);
////		secondTab.setIcon(R.drawable.menuitem_catch_normal);
////		secondTab.setIconSelected(R.drawable.menuitem_catch_selected);
////		secondTab.setTagTitle(R.string.MENU_CATCH);
////		
////		
		thirdTab = new Tab(context, "Three");
		thirdTab.setIntent(new Intent(context,Cards.class),2);
		thirdTab.setIcon(R.drawable.menu_card);
		thirdTab.setIconSelected(R.drawable.menu_card);
		thirdTab.setTagTitle(R.string.Cards);
//		thirdTab = new Tab(context, "Three");
////		thirdTab.setIntent(new Intent(context,CollectionListView.class),2);
////		thirdTab.setIcon(R.drawable.menuitem_collection_normal);
////		thirdTab.setIconSelected(R.drawable.menuitem_collection_selected);
////		thirdTab.setTagTitle(R.string.MENU_COLLECTION);
////
////		
////	
		fourTab = new Tab(context, "Four");
		fourTab.setIntent(new Intent(context,Divination.class),3);
		fourTab.setIcon(R.drawable.menu_reading);
		fourTab.setIconSelected(R.drawable.menu_reading);
		fourTab.setTagTitle(R.string.Divination);
//		
////		fourTab = new Tab(context, "Four");
////		fourTab.setIntent(new Intent(context,InfoView.class),3);
////		fourTab.setIcon(R.drawable.menuitem_info_normal);
////		fourTab.setIconSelected(R.drawable.menuitem_info_selected);
////		fourTab.setTagTitle(R.string.MENU_INFO);
//		
		
		
		tabView.addTab(firstTab);
		tabView.addTab(secondTab);
		tabView.addTab(thirdTab);
		tabView.addTab(fourTab);

		
		//tabView.setCurrentView(R.layout.index);
		
		//updateNotifications();
		return tabView;
	}
	
//	public void updateNotifications() {
//		ButterflyService service = ButterflyService.getInstance(context.getApplicationContext());
//		if (service.getNewButterflyCount() > 0) {
//			thirdTab.setIcon(R.drawable.menuitem_collection_normal_new);
//			thirdTab.setIcon(R.drawable.menuitem_collection_selected_new);
//		} else {
//			thirdTab.setIcon(R.drawable.menuitem_collection_normal);
//			thirdTab.setIcon(R.drawable.menuitem_collection_selected);
//		}
//	}

}
